﻿using Baby.Shop.Application.Contracts.Common.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Baby.Shop.Application.Contracts.Common.Helper.Linq
{
    /// <summary>
    /// 
    /// </summary>
    public class QueryInput
    {
        /// <summary>
        /// 
        /// </summary>
        public int PageIndex { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int PageSize { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string SortFiled { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string SortType { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public List<QueryEntity> Entities { get; set; }
    }
    /// <summary>
    /// 查询实体
    /// </summary>
    public class QueryEntity
    {
        /// <summary>
        /// 字段名称
        /// </summary>
        public string Field { get; set; }

        /// <summary>
        /// 值
        /// </summary>
        public object Value { get; set; }

        /// <summary>
        /// 操作方法，对应OperatorEnum枚举类
        /// </summary>
        public OperatorEnum Method { get; set; }

        /// <summary>
        /// 逻辑运算符，只支持AND、OR
        /// </summary>
        public string LogicalOperator { get; set; } = "AND";
    }
}
